package com.ryskoo.permission.rolemenurel.repository;

import com.ryskoo.framework.core.repository.BasicJPAImpl;
import com.ryskoo.permission.rolemenurel.domain.RoleMenuRelPO;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

/**
 * @author Shawn
 */
@Repository
public class RoleMenuRelJPAImpl extends BasicJPAImpl<RoleMenuRelPO> implements IRoleMenuRelRepository {
	/**
	 * 根据角色id删除角色与菜单的关联关系
	 *
	 * @param roleId 角色id
	 */
	@Override
	public void deleteRoleMenuRelByRoleId(String roleId) {
		String hql = "delete from RoleMenuRelPO where roleId = :roleId";
		Query query = getH4Session().createQuery(hql);
		query.setString("roleId", roleId);
		query.executeUpdate();
	}
}
